package org.xtext.mydsl.serializer;

import com.google.inject.Inject;
import com.google.inject.Provider;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider;
import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.GenericSequencer;
import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
import org.xtext.mydsl.scheduler.ActividadA;
import org.xtext.mydsl.scheduler.Block;
import org.xtext.mydsl.scheduler.Break;
import org.xtext.mydsl.scheduler.Charla;
import org.xtext.mydsl.scheduler.Cierre;
import org.xtext.mydsl.scheduler.Conferencia;
import org.xtext.mydsl.scheduler.Dia;
import org.xtext.mydsl.scheduler.Dicta;
import org.xtext.mydsl.scheduler.EspacioPC;
import org.xtext.mydsl.scheduler.EspacioRegular;
import org.xtext.mydsl.scheduler.Inaguracion;
import org.xtext.mydsl.scheduler.InfoEspacio;
import org.xtext.mydsl.scheduler.InformacionActividad;
import org.xtext.mydsl.scheduler.MesaDebate;
import org.xtext.mydsl.scheduler.Orador;
import org.xtext.mydsl.scheduler.Refrigerio;
import org.xtext.mydsl.scheduler.SchedulerPackage;
import org.xtext.mydsl.scheduler.Taller;
import org.xtext.mydsl.scheduler.Time;
import org.xtext.mydsl.scheduler.Track;
import org.xtext.mydsl.services.SchedulerGrammarAccess;

@SuppressWarnings("all")
public class SchedulerSemanticSequencer extends AbstractDelegatingSemanticSequencer {

	@Inject
	private SchedulerGrammarAccess grammarAccess;
	
	public void createSequence(EObject context, EObject semanticObject) {
		if(semanticObject.eClass().getEPackage() == SchedulerPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) {
			case SchedulerPackage.ACTIVIDAD_A:
				if(context == grammarAccess.getActividadARule()) {
					sequence_ActividadA(context, (ActividadA) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.BLOCK:
				if(context == grammarAccess.getBlockRule()) {
					sequence_Block(context, (Block) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.BREAK:
				if(context == grammarAccess.getActividadARule() ||
				   context == grammarAccess.getBreakRule()) {
					sequence_Break(context, (Break) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.CHARLA:
				if(context == grammarAccess.getActividadRule() ||
				   context == grammarAccess.getCharlaRule()) {
					sequence_Charla(context, (Charla) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.CIERRE:
				if(context == grammarAccess.getCierreRule()) {
					sequence_Cierre(context, (Cierre) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.CONFERENCIA:
				if(context == grammarAccess.getConferenciaRule()) {
					sequence_Conferencia(context, (Conferencia) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.DIA:
				if(context == grammarAccess.getDiaRule()) {
					sequence_Dia(context, (Dia) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.DICTA:
				if(context == grammarAccess.getDictaRule()) {
					sequence_Dicta(context, (Dicta) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.ESPACIO_PC:
				if(context == grammarAccess.getEspacioRule() ||
				   context == grammarAccess.getEspacioPCRule()) {
					sequence_EspacioPC(context, (EspacioPC) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.ESPACIO_REGULAR:
				if(context == grammarAccess.getEspacioRule() ||
				   context == grammarAccess.getEspacioRegularRule()) {
					sequence_EspacioRegular(context, (EspacioRegular) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.INAGURACION:
				if(context == grammarAccess.getInaguracionRule()) {
					sequence_Inaguracion(context, (Inaguracion) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.INFO_ESPACIO:
				if(context == grammarAccess.getInfoEspacioRule()) {
					sequence_InfoEspacio(context, (InfoEspacio) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.INFORMACION_ACTIVIDAD:
				if(context == grammarAccess.getInformacionActividadRule()) {
					sequence_InformacionActividad(context, (InformacionActividad) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.MESA_DEBATE:
				if(context == grammarAccess.getActividadRule() ||
				   context == grammarAccess.getMesaDebateRule()) {
					sequence_MesaDebate(context, (MesaDebate) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.ORADOR:
				if(context == grammarAccess.getOradorRule()) {
					sequence_Orador(context, (Orador) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.REFRIGERIO:
				if(context == grammarAccess.getActividadARule() ||
				   context == grammarAccess.getRefrigerioRule()) {
					sequence_Refrigerio(context, (Refrigerio) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.TALLER:
				if(context == grammarAccess.getActividadRule() ||
				   context == grammarAccess.getTallerRule()) {
					sequence_Taller(context, (Taller) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.TIME:
				if(context == grammarAccess.getTimeRule()) {
					sequence_Time(context, (Time) semanticObject); 
					return; 
				}
				else break;
			case SchedulerPackage.TRACK:
				if(context == grammarAccess.getTrackRule()) {
					sequence_Track(context, (Track) semanticObject); 
					return; 
				}
				else break;
			}
		if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
	}
	
	/**
	 * Constraint:
	 *     time=Time
	 */
	protected void sequence_ActividadA(EObject context, ActividadA semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (actividades+=Actividad* break1=ActividadA?)
	 */
	protected void sequence_Block(EObject context, Block semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     minutos=INT
	 */
	protected void sequence_Break(EObject context, Break semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (informacion=InformacionActividad oradores+=[Orador|ID]+ track=Track)
	 */
	protected void sequence_Charla(EObject context, Charla semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     minutos=INT
	 */
	protected void sequence_Cierre(EObject context, Cierre semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.CIERRE__MINUTOS) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.CIERRE__MINUTOS));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getCierreAccess().getMinutosINTTerminalRuleCall_1_0(), semanticObject.getMinutos());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (name=STRING oradores+=Orador+ espacios+=Espacio+ dias+=Dia+)
	 */
	protected void sequence_Conferencia(EObject context, Conferencia semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (numero=INT inauguracion=Inaguracion eventos+=Dicta+ cierre=Cierre)
	 */
	protected void sequence_Dia(EObject context, Dia semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (block=Block espacio=[Espacio|ID])
	 */
	protected void sequence_Dicta(EObject context, Dicta semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.DICTA__BLOCK) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.DICTA__BLOCK));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.DICTA__ESPACIO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.DICTA__ESPACIO));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getDictaAccess().getBlockBlockParserRuleCall_0_0(), semanticObject.getBlock());
		feeder.accept(grammarAccess.getDictaAccess().getEspacioEspacioIDTerminalRuleCall_2_0_1(), semanticObject.getEspacio());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID informacion=InfoEspacio)
	 */
	protected void sequence_EspacioPC(EObject context, EspacioPC semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ESPACIO__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ESPACIO__NAME));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ESPACIO__INFORMACION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ESPACIO__INFORMACION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getEspacioPCAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
		feeder.accept(grammarAccess.getEspacioPCAccess().getInformacionInfoEspacioParserRuleCall_2_0(), semanticObject.getInformacion());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID informacion=InfoEspacio)
	 */
	protected void sequence_EspacioRegular(EObject context, EspacioRegular semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ESPACIO__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ESPACIO__NAME));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ESPACIO__INFORMACION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ESPACIO__INFORMACION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getEspacioRegularAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
		feeder.accept(grammarAccess.getEspacioRegularAccess().getInformacionInfoEspacioParserRuleCall_2_0(), semanticObject.getInformacion());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (horario=Time minutos=INT)
	 */
	protected void sequence_Inaguracion(EObject context, Inaguracion semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INAGURACION__HORARIO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INAGURACION__HORARIO));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INAGURACION__MINUTOS) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INAGURACION__MINUTOS));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getInaguracionAccess().getHorarioTimeParserRuleCall_1_0(), semanticObject.getHorario());
		feeder.accept(grammarAccess.getInaguracionAccess().getMinutosINTTerminalRuleCall_3_0(), semanticObject.getMinutos());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     cant=INT
	 */
	protected void sequence_InfoEspacio(EObject context, InfoEspacio semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INFO_ESPACIO__CANT) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INFO_ESPACIO__CANT));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getInfoEspacioAccess().getCantINTTerminalRuleCall_1_0(), semanticObject.getCant());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (titulo=ID duracion=INT numEspect=INT)
	 */
	protected void sequence_InformacionActividad(EObject context, InformacionActividad semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__TITULO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__TITULO));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__DURACION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__DURACION));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__NUM_ESPECT) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.INFORMACION_ACTIVIDAD__NUM_ESPECT));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getInformacionActividadAccess().getTituloIDTerminalRuleCall_0_0(), semanticObject.getTitulo());
		feeder.accept(grammarAccess.getInformacionActividadAccess().getDuracionINTTerminalRuleCall_2_0(), semanticObject.getDuracion());
		feeder.accept(grammarAccess.getInformacionActividadAccess().getNumEspectINTTerminalRuleCall_4_0(), semanticObject.getNumEspect());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (informacion=InformacionActividad ladoA+=[Orador|ID]+ ladoB+=[Orador|ID]+)
	 */
	protected void sequence_MesaDebate(EObject context, MesaDebate semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID organizacion=ID)
	 */
	protected void sequence_Orador(EObject context, Orador semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ORADOR__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ORADOR__NAME));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ORADOR__ORGANIZACION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ORADOR__ORGANIZACION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getOradorAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
		feeder.accept(grammarAccess.getOradorAccess().getOrganizacionIDTerminalRuleCall_3_0(), semanticObject.getOrganizacion());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (minutos=INT | minutos=INT)
	 */
	protected void sequence_Refrigerio(EObject context, Refrigerio semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     informacion=InformacionActividad
	 */
	protected void sequence_Taller(EObject context, Taller semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.ACTIVIDAD__INFORMACION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.ACTIVIDAD__INFORMACION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getTallerAccess().getInformacionInformacionActividadParserRuleCall_1_0(), semanticObject.getInformacion());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (hora=INT minuto=INT)
	 */
	protected void sequence_Time(EObject context, Time semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.TIME__HORA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.TIME__HORA));
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.TIME__MINUTO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.TIME__MINUTO));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getTimeAccess().getHoraINTTerminalRuleCall_0_0(), semanticObject.getHora());
		feeder.accept(grammarAccess.getTimeAccess().getMinutoINTTerminalRuleCall_2_0(), semanticObject.getMinuto());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     tema=STRING
	 */
	protected void sequence_Track(EObject context, Track semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, SchedulerPackage.Literals.TRACK__TEMA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SchedulerPackage.Literals.TRACK__TEMA));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getTrackAccess().getTemaSTRINGTerminalRuleCall_1_0(), semanticObject.getTema());
		feeder.finish();
	}
}
